using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace HRM.Models.Mapping
{
    public class dk_QLSuPhamMap : EntityTypeConfiguration<dk_QLSuPham>
    {
        public dk_QLSuPhamMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.HocKi)
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.TenNV)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.MaDDKy)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.MaDKQLSP)
                .IsRequired()
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("dk_QLSuPham");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.SoLuong).HasColumnName("SoLuong");
            this.Property(t => t.HocKi).HasColumnName("HocKi");
            this.Property(t => t.TenNV).HasColumnName("TenNV");
            this.Property(t => t.MaDDKy).HasColumnName("MaDDKy");
            this.Property(t => t.MaDKQLSP).HasColumnName("MaDKQLSP");
        }
    }
}
